;
(function ($, window, document, undefined) {
    var loadingEX = function (ele, opt) {
        this.$element = ele;
        this.defaultSetting = {
            className: '',
            loadingText: 'LOADING',
            type: 'box',
        };
        this.options = $.extend({}, this.defaultSetting, opt);
        this.stutas = false;
    };
    //定义loadingEX的方法
    loadingEX.prototype = {
        render: function () {
            var html = '';
            html += '<div class="loadingEx ' + this.options.SclassName + '">';
            html += '   <div class="loadingBody">';
            html += '       <div class="loadingImg"><img src="./portal/img/loading.svg" alt=""></div>';
            html += '       <div class="loadingText">' + this.options.loadingText + '</div>';
            html += '   </div>';
            html += '</div>';
            this.html = $(html);
        },
        show: function () {
            if (this.$element.find(' > .loadingEx').length != 0) {
                return this.$element.find('> .loadingEx').remove();
            } else {
                this.render();
                if (this.$element.selector == 'body') {
                    this.html.css('position', 'fixed');
                };
                return this.$element.append(this.html);
            };
        }
    };
    //在插件中使用loadingEX对象
    $.fn.loadingEX = function (options) {
        new loadingEX(this, options).show();
        //创建loadingEX的实体
        //调用其方法
        return this;
    };
})(jQuery, window, document);